#!/bin/bash
# usage: ./check_all.sh <num_experiments>

num_experiments=$1
check_one_script="./check_one.sh"

# Define the list of specifications to check
SPECS=("liveness-chor1-byz.ta" "liveness-chor2-byz.ta" "liveness-friedman-byz.ta" "liveness-king-byz.ta" "liveness-rabin-byz.ta"
       "safety-chor1-byz.ta"   "safety-chor2-byz.ta"   "safety-friedman-byz.ta"   "safety-king-byz.ta"   "safety-rabin-byz.ta"   "safety-mostefa-byz.ta")
TESTS=("liveness-chor1-byz.ta" "liveness-chor2-byz.ta")
# Loop over each specification
for spec in "${SPECS[@]}"
do
    case "$spec" in
        "liveness-chor1-byz.ta")
            properties=("round_term" "phase1" "phase2")
            ;;
        "liveness-chor2-byz.ta")
            properties=("round_term" "cb0")
            ;;
        "liveness-friedman-byz.ta")
            properties=("round_term" "cb0")
            ;;
        "liveness-king-byz.ta")
            properties=("round_term" "phase1" "phase2")
            ;;
        "liveness-rabin-byz.ta")
            properties=("round_term" "cb0")
            ;;
        "safety-chor1-byz.ta")
            properties=("round_term" "agree0" "valid0")
            ;;
        "safety-chor2-byz.ta")
            properties=("round_term" "agree0" "valid0")
            ;;
        "safety-friedman-byz.ta")
            properties=("round_term" "agree0" "valid0")
            ;;
        "safety-king-byz.ta")
            properties=("round_term" "agree0" "valid0")
            ;;
        "safety-rabin-byz.ta")
            properties=("agree0" "valid0")
            ;;
        "safety-mostefa-byz.ta")
            properties=("nonblocking" "agree0" "valid0")
            ;;
        *)
            echo "Unknown specification: $spec"
            ;;
    esac

    # Loop over the properties for the current specification
    for prop in "${properties[@]}"
    do
        $check_one_script "$spec" "$prop" "$num_experiments"
        # $check_one_script "$spec" "$prop" "$num_experiments" 2
    done
done
